package Timesheet.util;

import java.util.ArrayList;
import java.util.Date;

import oracle.adfmf.java.beans.PropertyChangeListener;
import oracle.adfmf.java.beans.PropertyChangeSupport;


public class TsCalendar {

    private String periodType;
    private String periodID;
    private Date startDate;
    private Date endDate;
    private int periodSeq;    

    private ArrayList durList = new ArrayList();
    private ArrayList holidayList = new ArrayList();
    private transient PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);

    public TsCalendar(String periodType, String periodID, Date startDate, Date endDate, int periodSeq) {
        super();
        this.periodType = periodType;
        this.periodID = periodID;
        this.startDate = startDate;
        this.endDate = endDate;
        this.periodSeq = periodSeq;
    }
    
    public void addPropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.addPropertyChangeListener(l);
    }

    public void removePropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.removePropertyChangeListener(l);
    }

    public void setStartDate(Date startDate) {
        Date oldStartDate = this.startDate;
        this.startDate = startDate;
        propertyChangeSupport.firePropertyChange("StartDate", oldStartDate, startDate);
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setEndDate(Date endDate) {
        Date oldEndDate = this.endDate;
        this.endDate = endDate;
        propertyChangeSupport.firePropertyChange("EndDate", oldEndDate, endDate);
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setPeriodSeq(int periodSeq) {
        int oldPeriodSeq = this.periodSeq;
        this.periodSeq = periodSeq;
        propertyChangeSupport.firePropertyChange("periodSeq", oldPeriodSeq, periodSeq);
    }

    public int getPeriodSeq() {
        return periodSeq;
    }

    public void setPeriodType(String periodType) {
        String oldPeriodType = this.periodType;
        this.periodType = periodType;
        propertyChangeSupport.firePropertyChange("periodType", oldPeriodType, periodType);
    }

    public String getPeriodType() {
        return periodType;
    }
}
